<script setup lang="ts">
import { useCounterStore } from '@/stores/counter'
import { ref } from 'vue'
import CreateGamePop from './CreateGamePop.vue'
import { useLayoutStore } from '@/stores/layoutStore';
const tableData = [
  {
    date: '2016-05-03',
    name: 'Tom',
    address: 'No. 189, Grove St, Los Angeles'
  }
]
const stateValue = ref('全部状态')
const stateList = [
  {name:'全部状态',value:'全部状态'},
  {name:'未上传',value:'未上传'},
  {name:'未发布',value:'未发布'},
  {name:'完成',value:'完成'},
];

const createGameClick = ()=>{
  useLayoutStore().createGamePopVisible = true
}
</script>

<template>
  <div class="content">
    <div class="top">
      <el-input placeholder="请输入游戏名称" >
        <template #prefix>
          <el-icon class="el-input__icon"><search /></el-icon>
        </template>
      </el-input>
      <div class="selectContent">
        <span>状态：</span>
        <el-select v-model="stateValue" placeholder="Select">
          <el-option v-for="item in stateList" :key="item.value" :label="item.name" :value="item.value"/>
        </el-select>
      </div>
      <div style="flex:1"></div>
      <el-button type="primary" @click=createGameClick>新建</el-button>
    </div>
    <el-table :data="tableData" height="280" style="width: 100%">
      <el-table-column prop="date" label="游戏名称" width="180" />
      <el-table-column prop="name" label="地址" width="180" />
      <el-table-column prop="address" label="状态" />
    </el-table>
    <CreateGamePop />
  </div>
</template>
<style scoped>
.content {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  column-gap: 30px;
  row-gap: 20px;
  .top{
    width: 100%;
    height: 60px;
    padding: 0 20px;
    border: 1px solid #dcdfe6;
    border-radius: 5px;
    column-gap: 30px;
    display: flex;
    align-items: center;
    .selectContent{
      display: flex;
      align-items: center;
      width: 180px;
      white-space: nowarp;
      .el-select{
        width:100px;
      }
    }
    .el-input{
      width:200px;
    }
  }
}
</style>
